from django.db import models


# 用户类型
class UserType(models.Model):
    name = models.CharField(max_length=9)


# Create your models here.
# 创建用户
class UserInfo(models.Model):
    # ID列，自增，主键
    # 用户名 主键
    username = models.CharField(max_length=9, primary_key=True)
    # 密码
    password = models.CharField(max_length=32)
    # 用户类型
    user_type = models.ForeignKey(UserType, on_delete=models.CASCADE)
    # 更新时间
    uptime = models.DateTimeField(auto_now=True, null=True)
    # 创建时间
    ctime = models.DateTimeField(auto_now_add=True, null=True)
